package main

import (
	"fmt"
	"log"
	"net/http"
)

func main() {
	fmt.Println("http client start ...")
	resp, err := http.Get("http://127.0.0.1:80/go")
	if err != nil {
		log.Fatal(err)
		return
	}
	defer resp.Body.Close()

	buff := make([]byte, 1024)
	for {
		n, err := resp.Body.Read(buff)
		if err != nil && err.Error() != "EOF" {
			log.Fatal(err)
		} else {
			fmt.Printf("string(buff[:n]): %v\n", string(buff[:n]))
			break
		}
	}
}
